<div ng-controller="CustomsorderCtrl" ng-init="configaddAction()">
    <ul class="sui-breadcrumb">
        <li><a href="#/customsorder/list">{{'外部订单'| translate}}</a></li>
        <li><a href="#/customsorder/configlist">{{'配置'| translate}}</a></li>
        <li class="active">
            {{"创建"|translate}}
        </li>
    </ul>
    <div class="sui-form form-horizontal">
        <form name="storeForm" novalidate ng-if="configData">
            <div class="control-group">
                <label class="control-label v-top">{{'电商平台'|translate}}:</label>
                <div class="controls">
                    <customs-order-type ng-if="!configData.customs_config_id" ng-model="configData.type" dft="1"></customs-order-type>
                    <customs-order-type ng-if="configData.customs_config_id" ng-model="configData.type" stype="1"></customs-order-type>
                </div>
            </div>
            <div ng-if="configData.type=='HZW'">
                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'用户名'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.userName" name="userName" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.userName.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'appkey'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.appkey" name="appkey" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.appkey.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'发货仓库'|translate}} :</label>
                    <div class="controls">
                        <pickpoint-list ng-model="configData.config.pick_point_id" dft="0"></pickpoint-list>
                        <div ng-show="storeForm.pick_point_id.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>
            </div>
            <div ng-if="configData.type=='PDD'">
                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'client_id'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.client_id" name="client_id" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.client_id.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'client_secret'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.client_secret" name="client_secret" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.client_secret.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'拼多多店铺ID'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.owner_id" name="owner_id" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.owner_id.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'拼多多店铺账号名'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.owner_name" name="owner_name" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.owner_name.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'发货仓库'|translate}} :</label>
                    <div class="controls">
                        <pickpoint-list ng-model="configData.config.pick_point_id" dft="0"></pickpoint-list>
                        <div ng-show="storeForm.pick_point_id.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>
            </div>
            <div ng-if="configData.type=='YUOU'">
                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'appKey'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.appKey" name="appKey" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.appKey.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'secret'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.secret" name="secret" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.secret.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'新版AppKey'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.newAppKey" name="newAppKey" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.appKey.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'新版Secret'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.newSecret" name="newSecret" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.secret.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>


                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'发货仓库'|translate}} :</label>
                    <div class="controls">
                        <pickpoint-list ng-model="configData.config.pick_point_id" dft="0"></pickpoint-list>
                        <div ng-show="storeForm.pick_point_id.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>
            </div>
            <div ng-if="configData.type=='TB'">
                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'用户名'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.userName" name="userName" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.userName.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'秘钥'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.appSecret" name="appSecret" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.appSecret.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'发货仓库'|translate}} :</label>
                    <div class="controls">
                        <pickpoint-list ng-model="configData.config.pick_point_id" dft="0"></pickpoint-list>
                        <div ng-show="storeForm.pick_point_id.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>
            </div>

            <div ng-if="configData.type=='HPK'">
                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'supplierSenderID'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.supplierSenderID" name="supplierSenderID" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.userName.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'海拍客Appkey'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.HpkAppKey" name="HpkAppKey" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.userName.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'海拍客Secret'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.HpkAppSecret" name="HpkAppSecret" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.appSecret.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'大写机构编码'|translate}} :</label>
                    <div class="controls">
                        <input ng-model="configData.config.HPKjigou" name="HPKjigou" type="text" value="" class="input-xlarge" required>
                        <div ng-show="storeForm.appSecret.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label v-top"><b style="color: #f00;">*</b> {{'发货仓库'|translate}} :</label>
                    <div class="controls">
                        <pickpoint-list ng-model="configData.config.pick_point_id" dft="0"></pickpoint-list>
                        <div ng-show="storeForm.pick_point_id.$error.required" class="sui-msg msg-error msg-clear help-block error">
                            <div class="msg-con">{{'required'| translate}}</div>
                            <s class="msg-icon"></s>
                        </div>
                    </div>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label"></label>
                <div class="controls">
                    <button ng-click="configAdd()" class="sui-btn btn-primary">
                        {{'save' | translate}}
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>